<%@ page import="java.util.ArrayList" %>
<%@ page import="entity.Kind" %>
<%@ page import="java.lang.reflect.InvocationTargetException" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/4/6
  Time: 21:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        window.onload = function(){
            var kindSelect = document.getElementById("kindSelect");
            kindSelect.onchange = function(){
                //window.alert(this.value);
                window.location.href = "selectCommodity?kid="+this.value;
            }
        }
    </script>
</head>
<body>
       商品如下  下拉<br>
       <select name="kid" id="kindSelect">
           <option value=""></option>
           <%
               ArrayList<Kind> kindList = (ArrayList<Kind>) request.getAttribute("kindList");
               for (Kind kind : kindList) {
                   out.write("<option value=\""+kind.getKid()+"\">"+kind.getKname()+"</option>");
               }
           %>
       </select>
</body>
</html>
